{% extends "base/base.html" %}
{% import "macro/display.html" as display -%}
{% block title %}{{ gettext("Inbox") }}{% endblock %}

{% block main %}
<h2><img class="icon_header" src="{{ STATIC_URL }}email.png" alt="" />Inbox - {{ pms|e }} {{ gettext("Private Messages") }}</h2>

{% if pms != "sent" %}<a href="{{ url("dv-inbox") }}?type=sent">{{ gettext("View Sent Messages") }}</a>{% endif %}

{% set objs, paging = dv.paginate(mails) %}

<table class="songlist">

<tr><th>{{ gettext("Subject") }}</th><th>{{ gettext("From") }}</th><th>{{ gettext("To") }}</th><th>{{ gettext("Sent Date") }}</th></tr>
{% for mail in objs %}
<tr class="{{ loop.cycle('row1', 'row2') }}">
 <td><a href="{{ mail.get_absolute_url() }}">{{ mail.subject|e }}</a>{% if mail.unread %} <img src="{{ STATIC_URL }}new.png" alt="[New Message]" />{% endif %}</td>
 <td>{{ display.user(mail.sender) }}</td>
 <td>{{ display.user(mail.to) }}</td>
 <td>{{ display.datetime(mail.sent) }}</td>
 {% if pms != "sent" %}<td><a href=".?delete={{ mail.id }}">{{ gettext("Delete") }}</a></td>{% endif %}
</tr>
{% endfor %}
</table>

{{ paging }}

{% endblock %}

